Conjugate Hylomorphisms

نویسندگان

  • Ralf Hinze
  • Nicolas Wu
  • Jeremy Gibbons
چکیده

The past decades have witnessed an extensive study of structured recursion schemes. A general scheme is the hylomorphism, which captures the essence of divide-and-conquer: a problem is broken into sub-problems by a coalgebra; sub-problems are solved recursively; the sub-solutions are combined by an algebra to form a solution. In this paper we develop a simple toolbox for assembling recursive coalgebras, which by definition ensure that their hylo equations have unique solutions, whatever the algebra. Our main tool is the conjugate rule, a generic rule parametrized by an adjunction and a conjugate pair of natural transformations. We show that many basic adjunctions induce useful recursion schemes. In fact, almost every structured recursion scheme seems to arise as an instance of the conjugate rule. Further, we adapt our toolbox to the more expressive setting of parametrically recursive coalgebras, where the original input is also passed to the algebra. The formal development is complemented by a series of worked-out examples in Haskell.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Deriving Structural Hylomorphisms From Recursive De nitions

ion, abstracting recursive function calls to derive hylomorphisms and abstracting maximal non-recursive subterms to structure hylomorphisms. A prototype of our algorithm has been implemented and tested extensively, showing its promise to be embedded in a real system. Finally, our algorithm gives the evidence that hylomorphisms can specify all recursions of interests as claimed in [BdM94].

متن کامل

An Extension of the Acid Rain Theorem

Program fusion (or deforestation) is a well-known transformation whereby compositions of several pieces of code are fused into a single one, resulting in an e cient functional program without intermediate data structures. Recent work has made it clear that fusion transformation is especially successful if recursions are expressed in terms of hylomorphisms . The point of this success is that fus...

متن کامل

"Everything Is Everything" Revisited: Shapeshifting Data Types with Isomorphisms and Hylomorphisms

This paper is an exploration of isomorphisms between elementary data types (e.g., natural numbers, sets, finite functions, graphs, hypergraphs) and their extension to hereditarily finite universes through hylomorphisms derived from ranking/unranking and pairing/unpairing operations. An embedded higher order combinator language provides any-toany encodings automatically. A few examples of free a...

متن کامل

Towards Manipulation of Mutually Recursive Functions

In functional programming, Constructive Algorithmics is one of the promising approaches to program transformation, especially to fusion, in which a concept called hylomorphism plays quite an important role. However, previous studies have mainly focused on programs constructed by single recursive functions, whereas programs constructed by mutual recursion have been little investigated, particula...

متن کامل

Declarative Combinatorics: Isomorphisms, Hylomorphisms and Hereditarily Finite Data Types in Haskell

This paper is an exploration in a functional programming framework of isomorphisms between elementary data types (natural numbers, sets, finite functions, permutations binary decision diagrams, graphs, hypergraphs, parenthesis languages, dyadic rationals, DNA sequences etc.) and their extension to hereditarily finite universes through hylomorphisms derived from ranking/unranking and pairing/unp...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014